LassoScript Utility
Basics Browse Detail

[Net->ReadString]

Tag Link [Net->ReadString] Category Networking
Type Member Source Available Yes
Support Preferred Version 8.5
Change New Data Source Any
Output Type String Security None
Implementation Sets Lasso 8.5

Description

[Net->ReadString] reads string data from a network connection. If a character set has been set using [Net->SetEncoding] then that character set is used to translate data from the network into Lasso's string format. Alternately, [Net->Read] can be used to read a byte stream from the network.

The tag requires a single parameter which specifies how many bytes of data to read from the network. If the connection is returning multi-byte data this number may not correspond to the number of characters which will be read.

Syntax

[Var: 'myConnection' = (Net: 'www.example.com', 80)]
[$myConnection->(SetEncoding: 'iso-8859-1')]
[$myConnection->(Write: 'GET / HTTP/1.0\r\n')]
[$myConnection->(Write: '\r\n')]
[$myConnection->(ReadString: 32768)]

Parameters

Optional Parameters
Length The maximum length in bytes of data to read from the network connection.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.